struct CollIntersect{
	Vector NewCenter;
	Vector IntersectPoint;
	Vector IntersectNormal;
	float Interval;
	ULONG TriangleIndex;
};

class Collision{
public:
	bool SphereIntersectPoint(const Vector &Center, float Radius, const Vector &Velocity, const Vector &Point, float &tMax, Vector &CollisionNormal);
	bool SphereIntersectLineSegment(const Vector &Center, float Radius, Vector &Velocity, const Vector &v1, const Vector &v2, float &tMax, Vector &CollisionNormal);
	bool SphereIntersectTriangle(const Vector &Center, float Radius, const Vector &Velocity, const Triangle &CollTriangle, float &tMax, Vector &CollisionNormal);
	bool SphereIntersectPlane(Vector &planeNormal,const Vector &v1,const Vector &Center,const Vector &Velocity,float Radius,float &tMax);
	bool RayIntersectPlane(Triangle &testTriangle,Vector *Origin,Vector *Direction,float *t, Vector &IntersectionPoint);
	bool PointInTriangle(Vector point,const Triangle &triangle);
	bool CollideEllipsoid(const Vector &Center, const Vector &Radius, const Vector &Velocity,Vector &NewCenter, Vector &IntegrationVelocity);
	bool EllipsoidIntersectScene(const Vector &Center,const Vector &Radius,const Vector &Velocity,CollIntersect Intersections[],ULONG &IntersectionCount);
	bool SolveCollision(float a, float b, float c, float &t);
	Collision();
	~Collision();
private:
	USHORT m_nMaxIntersections;
	USHORT m_nMaxIterations;
	CollIntersect *m_pIntersections;
	char* m_strCollisionType;
};